<template>
  <div>
    <pre><code class="language-c">{{ content }}</code></pre>
  </div>
</template>

<script>
import Prism from 'prismjs'
import 'prismjs/themes/prism.css'
import 'prismjs/components/prism-c'

export default {
  props: {
    content: {
      type: String,
      required: true
    }
  },
  mounted() {
    Prism.highlightAll()
  }
}
</script>
<style scoped>
pre {
  overflow: auto;
  max-height: 100%; /* 设置最大高度，超过该高度将出现滚动条 */
  margin: 0;
  background-color: #ffffff;
}
</style>
